import request from '@/utils/request'
// 导出报价单
export function exportQuote(query) {
  return request({
    url: '/sks/quote/exportQuote',
    method: 'get',
    params: query,
  })
}

// 报价单详情预览
export function priview(query) {
  return request({
    url: '/sks/quote/priview',
    method: 'get',
    params:query
  })
}

// 删除展项
export function displayDelete(deptId) {
  return request({
    url: '/sks/quote/displayDelete/' + deptId,
    method: 'delete'
  })
}

// 编辑展项及产品清单
export function displayEdit(data) {
  return request({
    url: '/sks/quote/displayEdit',
    method: 'put',
    data:data
  })
}

// 根据id获取展项与产品关联信息
export function getDisplayInfo(query) {
  return request({
    url: '/sks/quote/getDisplayInfo',
    method: 'get',
    params:query
  })
}

// 新增展项及产品清单
export function displayAdd(data) {
   return request({
    url: '/sks/quote/displayAdd',
    method:"post", 
    // headers: {
    //   'Content-Type': 'application/x-www-form-urlencoded'
    // },
    data:data
  })
}

// 删除区域
export function areaDelete(deptId) {
  let str=""
  deptId.forEach((item,index)=>{
      if(index==deptId.length-1){
          str+=item
      }else{
          str+=item+","
      }
  })
  return request({
    url: '/sks/quote/areaDelete/'+str,
    method: 'delete',
  })
}

// 新增区域
export function areaAdd(params) {
  return request({
    url: '/sks/quote/areaAdd',
    method: 'post',
    params:params
  })
}
//根据编号获取报价详细信息
export function identifier(deptId) {
  return request({
    url: '/sks/quote/'+deptId,
    method: 'get',
  })
}
//获取报价单列表
export function quoteList(query) {
  return request({
    url: '/sks/quote/quoteList',
    method: 'get',
    params:query
  })
}
//删除报价单
export function quoteDelete(deptId) {
  return request({
    url: '/sks/quote/quoteDelete/'+deptId,
    method: 'delete',
  })
}
//编辑报价单
export function quoteEdit(query) {
  return request({
    url: 'sks/quote/quoteEdit',
    method: 'post',
    params:query
  })
}
//新增报价项目
export function quoteAdd(query) {
  return request({
    url: '/sks/quote/quoteAdd',
    method: 'post',
    params:query
  })
}

//新增演示方式
export function showType(data) {
  return request({
    url: '/sks/quote/showTypeEdit',
    method: 'put',
    data:data
  })
}

// 修改单条产品报价

export function displayProductEdit(data) {
  return request({
    url: '/sks/quote/displayProductEdit',
    method:'put',
    data:data
  })
}